package com.dragon.concurrent.demo.test;

/**
 * 并发编程演示案例2
 *
 * @author dragon
 * @since 2019/11/20
 */
public class ConCurrencyTest2 {

    public static void main(String[] args) {
        MyThread myThread = new MyThread();
        Thread thread1 = new Thread(myThread);
        Thread thread2 = new Thread(myThread);
        thread1.start();
        thread2.start();
    }
}

class MyThread implements Runnable {

    public static int a = 10;

    @Override
    public void run() {
        System.out.println("写开始");
        a = a + 10;
        System.out.println("a:" + a);
        System.out.println("写结束");
    }
}
